package com.yunsom.testdemo.design.absfactory;

import com.yunsom.testdemo.design.absfactory.color.ColorFactory;
import com.yunsom.testdemo.design.absfactory.shape.ShapeFactory;

/**
 * @author Xbao
 * @version 1.0
 * @description
 * @date 2021/3/9 17:34
 */
public class FactoryProducer {

  public static AbstractFactory getFactory(String factoryType){
    if (factoryType == null){
      return null;
    }

    if("Shape".equalsIgnoreCase(factoryType)){
      return new ShapeFactory();
    }
    if("Color".equalsIgnoreCase(factoryType)){
      return new ColorFactory();
    }
    return null;
  }

}
